//
//  ItemTableViewCell2.m
//  MKUITestApp
//
//  Created by sushangjin on 2020/6/5.
//  Copyright © 2020 sushangjin. All rights reserved.
//

#import "ItemTVCell2.h"

@implementation ItemTVCell2
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.numberOfLines = 0;
        self.nameLabel.font = [UIFont systemFontOfSize:24];
        [self.contentView addSubview:self.nameLabel];
        //
        self.nameLabel.translatesAutoresizingMaskIntoConstraints = NO;
        [self.nameLabel.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:30].active = YES;
        [self.nameLabel.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-30].active = YES;
        [self.nameLabel.topAnchor constraintEqualToAnchor:self.contentView.topAnchor constant:30].active = YES;
        [self.nameLabel.bottomAnchor constraintEqualToAnchor:self.contentView.bottomAnchor constant:-30].active = YES;
    }
    return self;
}
- (void)customReloadCellModel{
    [super customReloadCellModel];
    Item *modelObject = self.cellModel.modelValue;
    self.nameLabel.text = modelObject.name;
}
@end
